home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: news.sprintlink.net!mv!usenet
- From: ENGR@GSSI.MV.COM (Michael Furman)
- Subject: Re: [Help!] "Declaration syntax error" on interrupt program ?
- Message-ID: <DnE06H.Dnp@mv.mv.com>
- Mime-Version: 1.0
- Organization: GSSI
- Date: Mon, 26 Feb 1996 14:27:53 GMT
- References: <4gq1mk$8bl@jaring.my>
- X-Newsreader: WinVN 0.93.10
- X-Nntp-Posting-Host: gssi.mv.com
-
- In article <4gq1mk$8bl@jaring.my>, yinchau@pl.jaring.my says...
- >
- >Below is an example program from the Turbo C++ 3.0 Online Help.
- >However when I run the program, an error message appeared at line
- >"#####" stating that there is some "declaration syntax error" that I
- >failed to find out.
- >
- >Can anyone help me with my first involvement in "interrupts". TQ.
- >
- >___________________________________________________
- >
- >#include <dos.h>
- >#include <conio.h>
- >
- >void interrupt (*mybeep)( void )
- >{ #####
- > int i, j;
-
- You are just declared variable "mybeep" as pointer to some function. And
- after
- that you place body of function like if it is a real function definition -
- not just declaration of pointer - it is invalid. You can write:
-
- void interrupt (*mybeep)( void ); // This is a pointer to some function
-
- or (probably that is what you need):
-
- void interrupt mybeep( void ) // This is a definition of function
- {
- int i, j
- .............
- }
-
- <<< If you received it by E-mail: it is a copy of post to the newsgroup >>>
- ---------------------------------------------------------------
- Michael Furman, (603)893-1109
- Geophysical Survey Systems, Inc. fax:(603)889-3984
- 13 Klein Drive - P.O. Box 97 engr@gssi.mv.com
- North Salem, NH 03073-0097 71543.1334@compuserve.com
- ---------------------------------------------------------------
-
-